<div class="layui-footer">
	<!-- 底部固定区域 -->
</div>
</div>
{php} $currentRule = currentRuleId(){/php}
<script>
	layui.use(['layer', 'element'], function () {
		var layer = layui.layer;
		var $ = layui.jquery;

		$(document).ready(function () {
			$('#menu{:$currentRule["pid"]??0}').addClass('layui-nav-itemed')
			$('#menu{:$currentRule["id"]??0}').addClass('layui-this')
			$('#leftMenu>.layui-nav-item').on('click',function(){
				var url = $(this).find('a').data('url')
				var childrenNum = $(this).children().length;
				if(childrenNum<=1){
					window.location.href = url;
				}
			})
		})
		$.ajaxSetup({
			type: "POST",
			error: function (jqXHR, textStatus, errorThrown) {
				switch (jqXHR.status) {
					case (500):
						layer.alert("服务器系统内部错误",{icon:2});
						break;
					case (401):
						layer.alert("请登录",{icon:2});
						setTimeout(() => {
							window.location.href = '/admin/login'
						}, 3000);
						break;
					case (403):
						layer.alert("无权限执行此操作",{icon:2});
						break;
					case (408):
						layer.alert("请求超时",{icon:2});
						break;
					default:
						layer.alert("未知错误",{icon:2});
				}
			}
		});
	});
</script>
<script>

</script>
</body>

</html>